package com.huqing.icu.client;

import com.huqing.icu.base.IdReq;
import com.huqing.icu.inout.resp.user.UserInfoQueryResp;
import com.huqing.icu.req.UserNumIncrReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "rent-user", path = "/api/user/feign")
public interface UserFeignClient {

    /**
     * 根据用户ID查询用户信息
     */
    @GetMapping(value = "/{userId}", produces = "application/json")
    UserInfoQueryResp getUserById(@PathVariable("userId") Long userId);

    @PostMapping(value = "/query_list", produces = "application/json")
    List<UserInfoQueryResp> queryList(@RequestBody IdReq idReq);


    /**
     * 每日新增人数、用户总数+1
     *
     * @param incrReq
     * @return
     */
    @PostMapping(value = "/incr_user_num", produces = "application/json")
    String incrUserNum(@RequestBody UserNumIncrReq incrReq);

}
